Nomilo Fishpond Biogeochemical Analysis
  • Correlational Analysis
  • Fieldwork Templates

Data Analysis Workflow:

  • Introduction
    • Research Questions
  • Install Packages
  • Load Libraries
  • Import Raw Data
    • Procedure
    • View Raw Data
  • Tidy Raw Data
    • Tidying Processes
    • Merge and Impute Tidied Datasets
  • Processed Datasets
    • Export Tidied Datasets
    • Data Dictionaries
  • Exploratory Data Analysis
    • Profiles
  • Correlational Analysis

Nomilo Fishpond Biogoechemical Analysis

Author

Lysbeth Koster

Published

February 28, 2024

Introduction

[Explain the purpose of this website]

Research Questions

  1. How do changes in the Nomilo fishpond over time correlate with
Interactive Code

Throughout this document, hover over the numbered annotations to the right of code chunks to reveal detailed explanations and comments about the code. Where drop-down italicized text is present, expand by pressing on arrow to see code.

Install Packages

packages <- c("rio", "tidyverse", "janitor", "lubridate", "rmarkdown", "fs", "hms", "zoo", "corrplot", "kableExtra",
              "psych", "ggplot2")


for (pkg in packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

Load Libraries

library(rio)
library(tidyverse)
library(janitor)
library(lubridate)
library(rmarkdown)
library(fs)
library(hms)
library(zoo)
library(corrplot)
library(kableExtra)
library(psych)
library(ggplot2)
1
For importing excel data
2
For cleaning of data
3
For cleaning variable names
4
For cleaning dates
5
For displaying tables
6
For file path usage

Import Raw Data

Procedure

Define vector of files to import:

files_to_import <- dir_ls(path = "data/raw")

for (i in seq_along(files_to_import)) {
  cat(i, "= ", files_to_import[i], "\n")
}
1
Store the file paths of our raw data within the data/raw directory in files_to_import
2
Print each file path with its index
1 =  data/raw/2024-02-28_dfs.RData 
2 =  data/raw/2024-02-28_ksf-clam-growth.xlsx 
3 =  data/raw/2024-02-28_ksf-compiled-data.xlsx 
4 =  data/raw/2024-02-28_ksf-oyster-cylinder-growth.xlsx 
5 =  data/raw/2024-02-28_profile-data.xlsx 
6 =  data/raw/2024-02-28_water-samples.xlsx 
7 =  data/raw/2024-02-28_weather-data.xlsx 
8 =  data/raw/2024-03-01_dfs-no-profiles.RData 
9 =  data/raw/2024-03-01_dfs_no_profiles.RData 
10 =  data/raw/2024-03-04_dfs-no-profiles.RData 
11 =  data/raw/2024-03-08_dfs-no-profiles.RData 

Use the purrr::map() function to iteratively import files in the files_to_import vector except for the profiles data and .RData files:

@iteratively-import-raw-data Code Chunk Execution Warning

The @iteratively-import-raw-data code chunk should only be ran once when raw data is updated because it takes long to execute. Therefore, run the @efficiently-load-raw-data code chunk instead to easily import up-to-date raw data.

dfs_no_profiles <- map(files_to_import[c(2:4, 6, 7)], import_list)
current_date <- format(Sys.Date(), "%Y-%m-%d")
save(dfs_no_profiles, file = paste0("data/raw/", current_date, "_dfs-no-profiles.RData"))
Ensure the Correct Index Value is Inputted Below

Refer to the output of the files_to_import data object to ensure you are inputting the correct index value corresponding to the file path that needs to be loaded.

Efficiently import up-to-date raw data:

load(files_to_import[10])

Rename datasets:

We will always use snakecase when naming our data objects and functions (e.g., data_object_name or function_name()).

names(dfs_no_profiles) <- gsub("data/raw/2024-02-28_|\\.xlsx$|\\.xls$", "", 
                               files_to_import[c(2:4, 6, 7)])
names(dfs_no_profiles) <- gsub("-", "_", names(dfs_no_profiles))
names(dfs_no_profiles)
1
Remove prefixes and file extensions
2
Replace hyphens with underscores
3
Check if names were outputted correctly
[1] "ksf_clam_growth"            "ksf_compiled_data"         
[3] "ksf_oyster_cylinder_growth" "water_samples"             
[5] "weather_data"              

Rename each sheet within each raw dataset to be lowercased and replace spaces with underscores:

dfs_no_profiles <- map(dfs_no_profiles, ~ set_names(.x, gsub(" ", "_", tolower(names(.x)))))

Create separate datasets by specifying the Excel sheet from each spreadsheet we want to tidy:

ksf_clams_growth_data <- dfs_no_profiles$ksf_clam_growth$sheet1
ksf_compiled_data <- dfs_no_profiles$ksf_compiled_data$full_data
ksf_oyster_cylinder_growth_data <- dfs_no_profiles$ksf_oyster_cylinder_growth$sheet1
water_samples_data <- dfs_no_profiles$water_samples$data_overview
weather_data <- dfs_no_profiles$weather_data$weather_ksf
tidal_data <- dfs_no_profiles$ksf_compiled_data$tides

We want to combine multiple sheets within the profiles Excel spreadsheet into one, therefore, we will import it separately:

sheets_to_import <- c("L1", "L2", "L3", "L4")

profiles_data <- profiles_data <- map_dfr(sheets_to_import, function(sheet_name) {
  import(files_to_import[5], which = sheet_name)
}) %>%
  bind_rows()
1
[code annotation]
2
[code annotation]
3
[code annotation]

View Raw Data

  • ksf_clams_growth_data
  • ksf_compiled_data
  • ksf_oyster_cylinder_growth_data
  • water_samples_data
  • weather_data
  • profiles_data
  • tidal_data

Tidy Raw Data

Tidying Processes

  • ksf_clams_growth_data_tidied
  • ksf_compiled_data_tidied
  • ksf_oyster_cylinder_growth_data_tidied
  • water_samples_data_tidied
  • weather_data_tidied
  • profiles_data_tidied
  • tidal_data_tidied
Steps to clean data
new_clam_var_names <- c(
  "sort_date", "color", "clams_in_count", "clams_in_lbs",  "clams_in_avg_per_lb",
  "clams_out_count", "clams_out_lbs", "clams_out_avg_per_lb", "growth_in_lbs", 
  "growth_pct", "sr", "days_btwn_sort"
  )

new_clam_date_col <- c(
  "2023-10-17", "2023-12-06", "2023-12-12", "2024-01-02",  "2024-01-10", "2024-01-24",
  "2024-01-31", "2024-02-08", "2024-02-13"
  )

ksf_clams_growth_data_tidied <- ksf_clams_growth_data %>%
  slice(-1) %>%
  setNames(new_clam_var_names) %>%
  mutate(date = as.Date(new_clam_date_col)) %>%
  dplyr::select(-sort_date) %>%
   pivot_longer(
    cols = c(
      clams_in_count, clams_in_lbs, clams_in_avg_per_lb,   clams_out_count, 
      clams_out_lbs, clams_out_avg_per_lb
      ),
    names_to = c("stage", ".value"),
    names_prefix = "clams_",
    names_sep = "_",
    values_to = "value"
  ) %>%
  mutate(stage = if_else(str_detect(stage, "in"), "In", "Out")) %>%
  rename(avg_per_lbs = avg) %>%
  mutate(across(c(color, stage), as.factor)) %>%
  mutate(across(c(count, lbs, avg_per_lbs, growth_in_lbs, growth_pct, sr),
                ~as.numeric(gsub("%", "", .)))) %>%
  arrange(date, color, stage) %>%
  dplyr::select(date, days_btwn_sort, color, stage, count, lbs, avg_per_lbs,
                growth_in_lbs, growth_pct, sr) %>%
  rename("days_btwn_clams_sort" = days_btwn_sort,
         "clams_color" = color,
         "clams_stage" = stage,
         "clams_count" = count,
         "weight" = lbs,
         "avg_weight" = avg_per_lbs,
         "clams_growth" = growth_in_lbs,
         "clams_sr" = sr)
         

paged_table(ksf_clams_growth_data_tidied)
1
Manually set variable names
2
Assign dates to new date column
3
Delete first row
4
Set date as correct variable type and pivot data set based on date range.
5
Assign In and Out to stage
6
Rename variable of average to average per lbs
7
Set stage and color as factor variable types
8
Set variables as numeric variable types
9
Arrange values by date, color, and stage
Steps to clean data
ksf_compiled_data_tidied <- ksf_compiled_data %>% 
  rename_with(~gsub("\\s*\\([^\\)]+\\)", "", .x)) %>%
  janitor::clean_names() %>%
  rename(date = date_time) %>%
  mutate(date = as.Date(date)) %>%
  filter(date >= as.Date("2023-11-20") & date <= as.Date("2024-02-20")) %>%
  arrange(date) %>%
  dplyr::select(-c(external_voltage, wk_num, wind_dir,
                   spadd, outdoor_temperature, hourly_rain,
                   solar_radiation, resistivity, battery_capacity,
                   hour, daynum, data_pt, wind_sp, diradd,
                   wind_speed, wind_direction, tide, day, month, year)
                ) %>%
  dplyr::select(where(~ !anyNA(.))) %>%
  group_by(date) %>%
  summarise(across(where(is.numeric), \(x) mean(x, na.rm = TRUE))) %>%
  rename("ksf_salinity" = salinity,
         "ksf_rdo_saturation" = rdo_saturation,
         "ksf_rdo_concentration" = rdo_concentration,
         "ksf_actual_conductivity" = actual_conductivity,
         "ksf_total_dissolved_solids" = total_dissolved_solids,
         "ksf_ammonium" = ammonium,
         "ksf_barometric_pressure" = barometric_pressure,
         "ksf_oxygen_partial_pressure" = oxygen_partial_pressure,
         "ksf_specific_conductivity" = specific_conductivity,
         "ksf_density" = density,
         "ksf_chlorophyll_a_fluorescence" = chlorophyll_a_fluorescence,
         "ksf_ammonium_m_v" = ammonium_m_v)

paged_table(ksf_compiled_data_tidied)
1
Clean variable names by removing everything in parentheses, using lowercase and underscores in place of spaces
2
Rename the date_time variable to date, filter to desired date range and sort by date
3
Remove unnecessary variables
4
Remove columns with containing all NA values
5
Group by date and calculate the average of every variable for each day
Steps to clean data
oyster_var_names <- c(
  "date", "oyster_large_weight", "oyster_large_gain", "oyster_small_weight",
  "oyster_small_gain", "oyster_chlorophyll"
  )

ksf_oyster_cylinder_growth_data_tidied <- ksf_oyster_cylinder_growth_data %>% 
  dplyr::select(c(1, 4, 5, 8, 9, 12)) %>%
  slice(-1) %>%
  setNames(oyster_var_names) %>%
  pivot_longer(
    cols = c(oyster_large_weight, oyster_large_gain,
             oyster_small_gain,
             oyster_small_weight),
    names_to = c("oyster_size", ".value"),
    names_prefix = "oyster_",
    names_sep = "_",
    values_to = "value"
  ) %>%
  mutate(oyster_size = if_else(str_detect(oyster_size, "small"), "Small", "Large")) %>%
  mutate(date = as.Date(date),
         oyster_size = as.factor(oyster_size),
         across(c(weight, gain), as.numeric)
        ) %>%
  filter(date >= as.Date("2023-11-20") & date <=
           as.Date("2024-02-14")) %>%
  mutate(weight = weight * 0.00220462) %>% 
  rename("growth_pct" = gain)

paged_table(ksf_oyster_cylinder_growth_data_tidied)
1
Manually set variable names
2
Select desired columns and remove first row
3
Convert from wide to long format
4
Create a new variable that differentiates oyster size
5
Adjust data types to numeric and factor
6
Filter to desired date range
Steps to clean data
water_samples_data_tidied <- water_samples_data %>%
  slice(-c(44:52)) %>% 
  rename_with(~gsub("\\s*\\([^\\)]+\\)", "", .x)) %>%
  janitor::clean_names() %>%
  mutate(
    date = if_else(date == "44074",
            as.character(as.Date("2024-01-09")),
            format(dmy(date), "%Y-%m-%d"))
  ) %>%
  mutate(sample_id = 1:nrow(.)) %>%
  mutate(date = as.Date(date),
         across(c(nomilo_id, location, round, depth), as.factor)) %>%
  select(-c(sample_id, nomilo_id, tube_name))

paged_table(water_samples_data_tidied)
1
Clean variable names by removing everything in parentheses, using lowercase and underscores in place of spaces
2
Replaces incorrect date values and format as YYYY-MM-DD
3
Add values for sample ID
4
Set correct variable types
Steps to clean data
weather_data_tidied <- weather_data %>% 

janitor::clean_names() %>%
   unite(date, year, month, day, sep = "-") %>%
  mutate(date = ymd(date)) %>%
   select(-c(1, 3)) %>%
  rename("outdoor_temperature" = outdoor_temp_f) %>%
   mutate(outdoor_temperature = (outdoor_temperature - 32) * (5/9)) %>%
  group_by(date) %>%
  summarise(across(where(is.numeric), \(x) mean(x, na.rm = TRUE))) %>%
  slice(-1)

paged_table(weather_data_tidied)
1
Clean variable names
2
Merge separate day, month, year columns into one column variable and format as YYYY-MM-DD.
3
Cut columns
4
Rename outdoor temperature and convert from Fahrenheit to Celcius
5
Group by date and then take average values per day
6
Cut first row
Steps to clean data
new_profile_var_names <- c("depth", "water_temperature", "dissolved_oxygen", "salinity", "conductivity", "visibility", "location", "date")

profiles_data_tidied <- profiles_data %>%
  select(-c(6, 8)) %>%
  mutate(
    temp_column1 = NA_character_,
    temp_column2 = NA_character_
  ) %>%
  setNames(new_profile_var_names) %>%
  mutate(
    location = ifelse(depth == "Location", water_temperature, NA_character_), 
    date = ifelse(depth == "Date",  water_temperature, NA_character_)
  ) %>%
  fill(location, date, .direction = "down") %>%
  filter(depth != "Location", depth != "Date") %>%
  mutate(
    location = case_when(
      location == "L1 Northwest buoy" ~ "back buoy",
      location == "L2 Middle Buoy" ~ "mid buoy",
      location == "L3 Production Dock" ~ "production dock",
      location == "L4 Auwai" ~ "auwei",
      TRUE ~ location
    ),
    date = case_when(
      date %in% c("45258", "2023-11-28") ~ "2023-11-28",
      date %in% c("45282", "2023-12-21") ~ "2023-12-21",
      date %in% c("45536", "2024-01-09") ~ "2024-01-09",
      date %in% c("30/1/24", "30/01/24") ~ "2024-01-30",
      date %in% c("20/02/24", "20/2/24") ~ "2024-02-20",
      TRUE ~ date
    )) %>%
  mutate(
    date = as.Date(date, format = "%Y-%m-%d"),
    conductivity = case_when(
      row_number() %in% c(1:11) ~ NA_character_,
      TRUE ~ as.character(conductivity)
    )
  ) %>%
  filter(!(depth %in% c("Samples", "Depth"))) %>%
  mutate(date = as.Date(date),
         across(c(depth, location), as.factor),
         across(c(water_temperature,  dissolved_oxygen, salinity, 
                  conductivity,visibility),  as.numeric)) %>%
   fill(visibility, .direction = "down") %>%
  mutate(visibility = if_else(date == "2023-11-28",  NA_real_, visibility)) %>%
  mutate(location = str_to_title(location))

paged_table(profiles_data_tidied)
1
Set new variable names manually
2
Delete unnecessary columns
3
Temporarily create two new columns to replace the ones we deleted
4
Assign new profile variable names to rename variables in data set
5
Takes location from one column of location and date data, and assigns it to corresponding data of another column.
6
Fill values of temperature downwards in newly created date and location column.
7
Gets rid of the ‘location’ and ‘date’ rows that had empty values.
8
Renames values
9
Removes turbidity data rows 1:11
10
Looks for rows containing samples and depth names and negate these values.
11
Sets correct data types for each variable
12
Fills values from the temperature downwards into the newly created columns for date and location
Steps to clean data
tidal_data_tidied <- tidal_data %>% 

janitor::clean_names() %>%
  mutate(date = as.Date(date, format = "%Y-%m-%d"))  %>%
   filter(date >= as.Date("2023-11-20") & date <=  as.Date("2024-02-20")) %>%
  select(-2) %>%
  mutate(time = as_hms(format(time, "%H:%M:%S")),
         high_low = as.factor(high_low))
  
paged_table(tidal_data_tidied)
1
Clean variable names
2
Set date as correct variable type and format YYYY-MM-DD
3
Filter to desired date range
4
Cut column
5
Set time as time variable type
6
Set variable as factor type

Merge and Impute Tidied Datasets

  • Biogeochemical & Physical Variables
  • Clams
  • Oysters
# Merging
profiles_water_samples_merged <- reduce(list(profiles_data_tidied, water_samples_data_tidied), full_join, by = c("date", "location", "depth")) %>% 
  relocate(date, round, location, depth, .before = water_temperature) %>%
  arrange(date) %>% 
  fill(round, .direction = "down") %>%
  mutate(round = if_else(is.na(round), "1", round),
         round = as.factor(round))
# Complete dataset
compiled_weather_merged <- reduce(list(ksf_compiled_data_tidied, weather_data_tidied), full_join, by = "date")

biogeochem_vars_merged <- full_join(compiled_weather_merged, profiles_water_samples_merged)
# Interpolating
biogeochem_vars_interp <- biogeochem_vars_merged %>% 
  # Selects numeric columns with missing values, linearly interpolates NAs by 
  # drawing straight lines between existing points, and extends the outermost 
  # values to fill NAs at the start or end
  mutate(across(where(~is.numeric(.x) && any(is.na(.x))),
                ~na.approx(.x, na.rm = FALSE, rule = 2)))
paged_table(biogeochem_vars_interp)
Clams Growth Merged with Environmental Variables
# Merging
clams_growth_biogeochem_vars_merged <- full_join(ksf_clams_growth_data_tidied, biogeochem_vars_interp, by = "date")

# Interpolating -- other option is to aggregate to weekly or monthly, but dates 
# are very mismatched to aggregate to monthly and dataset would be very small if 
# aggregated to monthly
clams_growth_biogeochem_vars_interp <- clams_growth_biogeochem_vars_merged %>% 
 mutate(across(
    .cols = setdiff(names(.)[sapply(., function(col) is.numeric(col) &&
                                      any(is.na(col)))], "days_btwn_clams_sort"),
    .fns = ~na.approx(.x, na.rm = FALSE, rule = 2)
  )) %>%
  relocate(date, round, location, depth, clams_color, clams_stage, .before = days_btwn_clams_sort) %>% 
  arrange(date)
Oyster Growth Interpolated and Merged with Environmental Variables
oyster_growth_biogeochem_vars_merged <- full_join(ksf_oyster_cylinder_growth_data_tidied, biogeochem_vars_interp, by = "date")

# Interpolating -- other option is to aggregate to weekly or monthly, but dates 
# are very mismatched to aggregate to monthly and dataset would be very small if 
# aggregated to monthly

oyster_growth_biogeochem_vars_interp <- oyster_growth_biogeochem_vars_merged %>% 
 mutate(across(where(~is.numeric(.x) && any(is.na(.x))),
                ~na.approx(.x, na.rm = FALSE, rule = 2))) %>% 
 # relocate(date, round, location, depth, clams_color, clams_stage, .before = days_btwn_clams_sort) %>% 
  arrange(date)

Processed Datasets

Export Tidied Datasets

Export tidied datasets to CSV into data/tidied folder:

source("code/functions/export_to_csv.R")

dfs_to_export <- list(
  ksf_clams_growth_data_tidied = ksf_clams_growth_data_tidied,
  ksf_compiled_data_tidied = ksf_compiled_data_tidied,
  ksf_oyster_cylinder_growth_data_tidied = ksf_oyster_cylinder_growth_data_tidied,
  water_samples_data_tidied = water_samples_data_tidied,
  profiles_data_tidied = profiles_data_tidied
)

imap(dfs_to_export, ~ export_to_csv(.x, .y, "data/tidied"))
1
List of dataframes we want to export as CSV files
2
Iterate the export_to_csv(df, df_name, dir_path) function over each dataframe. .x refers to the dataframe. .y refers to the name of the dataframe. These are passed to export_to_csv() function along with the desired directory path.

Export merged final data set into data/outputs folder.

Data Dictionaries

Exploratory Data Analysis

Profiles

How is [salinity, dissolved oxygen, conductivity] distributed over the pond?

Get a visual per Location of how [variable] changes with depth over time

How is [salinity, dissolved oxygen, conductivity] distributed over depth profiles?

How do [salinity, dissolved oxygen, conductivity] change over time for each location?

Correlational Analysis

  • Clams
  • Oysters

All Relationships

KSF Clams Growth and Environmental Variables Correlation Matrix
clams_count weight avg_weight clams_growth growth_pct clams_sr ksf_rdo_concentration ksf_rdo_saturation ksf_oxygen_partial_pressure ksf_actual_conductivity ksf_specific_conductivity ksf_salinity ksf_density ksf_total_dissolved_solids ksf_chlorophyll_a_fluorescence ksf_ammonium ksf_ammonium_m_v ksf_barometric_pressure outdoor_temperature wind_speed_mph hourly_rain_inch_hr wind_direction water_temperature dissolved_oxygen salinity conductivity visibility chlorophyll_a phosphate silicate nitrate_nitrite ammonia heterotrophic_bacteria large_phytoplankton synechococcus_population_1 synechococcus_population_2 prochlorococcus lysbeths_mystery_cells_events
clams_count 1.0000000 0.0409859 0.6415282 0.3805422 0.2062033 0.3145692 0.0524704 0.0640567 0.0636534 0.0714031 0.0844293 0.0829652 0.0857606 0.0844293 0.0457172 -0.0936273 -0.0865921 -0.0347621 0.0195322 -0.0771027 -0.0359133 0.0859623 -0.0087378 -0.0339996 -0.0257305 0.0735778 -0.1033857 -0.1382774 -0.0096799 -0.0343243 -0.0040131 0.1001314 -0.0134360 -0.0134640 -0.1704429 0.0111838 -0.0571083 -0.0063553
weight 0.0409859 1.0000000 -0.3434222 -0.0616139 -0.1722201 -0.4942302 -0.0383302 -0.0163263 -0.0176265 0.0924908 0.0650358 0.0671382 0.0418348 0.0650358 -0.0461447 0.1048357 0.1002260 -0.0485050 0.2153271 0.0492198 -0.0429782 -0.1627664 -0.0283075 0.0585572 -0.0370530 -0.0828898 -0.0280149 -0.0349436 0.0099014 -0.0071649 -0.0055230 -0.0004394 -0.1929484 -0.1056756 -0.0900088 -0.0982964 -0.0479750 -0.1044493
avg_weight 0.6415282 -0.3434222 1.0000000 0.4814118 0.4289966 0.4980214 0.0705930 0.0835047 0.0825336 0.0525208 0.0543771 0.0531250 0.0500105 0.0543771 0.0257222 -0.0844702 -0.0740944 -0.0258200 -0.0463847 -0.1224943 -0.0246000 0.1188072 0.0140224 -0.0466382 -0.0197123 0.0876671 -0.0798640 -0.1103464 -0.0114536 -0.0285377 -0.0030057 0.0853619 0.0312324 -0.0053960 -0.1234927 0.0507049 -0.0505093 0.0083284
clams_growth 0.3805422 -0.0616139 0.4814118 1.0000000 0.8875344 0.0607922 0.0795870 0.1131158 0.1108430 0.2222781 0.2467517 0.2429415 0.2415053 0.2467517 -0.0206645 0.0181905 0.0096511 0.0092874 0.0280953 -0.0678494 0.0282027 -0.0022290 -0.0724172 0.0470053 0.0073467 -0.0112005 -0.1289768 -0.0833346 0.0093901 -0.0162806 0.0014382 0.0720179 -0.1159327 -0.0352733 -0.1443967 -0.1242146 -0.0604132 -0.0375336
growth_pct 0.2062033 -0.1722201 0.4289966 0.8875344 1.0000000 0.1067271 0.0552859 0.0854057 0.0828367 0.1448491 0.1345152 0.1337227 0.1152359 0.1345152 -0.0216596 0.0404987 0.0362214 -0.0051718 0.0293611 -0.1140219 0.0259283 0.0135303 -0.0428091 0.0201498 -0.0037962 -0.0072471 -0.0710852 -0.0450483 0.0060210 -0.0120325 -0.0003708 0.0453776 -0.0997131 -0.0456606 -0.1069427 -0.0849254 -0.0495029 -0.0466960
clams_sr 0.3145692 -0.4942302 0.4980214 0.0607922 0.1067271 1.0000000 -0.0006856 -0.0129245 -0.0127368 -0.1247776 -0.1497135 -0.1474096 -0.1542920 -0.1497135 0.0164766 -0.0837436 -0.0742769 0.0028538 -0.1178618 -0.0889728 -0.0063588 0.2201663 0.0923373 -0.0458471 0.0013861 0.0830528 0.0662712 0.0305550 -0.0109520 -0.0096234 0.0012419 0.0443999 0.1469761 0.0412013 0.0238956 0.1100994 -0.0781956 0.0764354
ksf_rdo_concentration 0.0524704 -0.0383302 0.0705930 0.0795870 0.0552859 -0.0006856 1.0000000 0.9764428 0.9814675 -0.1098617 0.0532594 0.0415236 0.1538986 0.0532595 0.3961686 -0.6618045 -0.6358065 0.4145333 -0.2292270 0.1534301 -0.4976613 0.0825067 -0.3420082 -0.5694751 -0.4279598 0.6284400 0.0619102 0.1924889 -0.1084354 -0.1583380 -0.0730007 0.2320883 -0.2382990 0.3234804 -0.5881012 -0.1334547 -0.1143586 0.2899786
ksf_rdo_saturation 0.0640567 -0.0163263 0.0835047 0.1131158 0.0854057 -0.0129245 0.9764428 1.0000000 0.9996512 0.0761464 0.1905001 0.1820462 0.2477928 0.1905002 0.3101946 -0.5775877 -0.5593437 0.3745947 -0.1084533 0.0352574 -0.4078243 0.1402555 -0.2087737 -0.4376101 -0.3404328 0.5010454 0.0970697 0.1981719 -0.0857122 -0.1456513 -0.0573293 0.2659219 -0.1919719 0.3103527 -0.5709042 -0.2235499 -0.2058450 0.2723317
ksf_oxygen_partial_pressure 0.0636534 -0.0176265 0.0825336 0.1108430 0.0828367 -0.0127368 0.9814675 0.9996512 1.0000000 0.0560263 0.1768071 0.1679188 0.2394484 0.1768072 0.3239955 -0.5902213 -0.5711790 0.3814287 -0.1232407 0.0498780 -0.4224166 0.1326193 -0.2262222 -0.4550635 -0.3518176 0.5180174 0.0914237 0.1958246 -0.0890570 -0.1484056 -0.0598036 0.2635519 -0.1996201 0.3129724 -0.5769949 -0.2146809 -0.1966661 0.2758581
ksf_actual_conductivity 0.0714031 0.0924908 0.0525208 0.2222781 0.1448491 -0.1247776 -0.1098617 0.0761464 0.0560263 1.0000000 0.9332353 0.9406537 0.8186142 0.9332353 -0.3510525 0.3996425 0.3148732 0.0031417 0.3959325 -0.5439259 0.5450024 0.0323238 0.2865474 0.7548221 0.5131651 -0.6892248 -0.1729555 -0.1916901 0.1386471 0.0658698 0.0881196 0.2197795 0.0290379 -0.0224513 -0.0254392 -0.6926454 -0.5511618 0.0235405
ksf_specific_conductivity 0.0844293 0.0650358 0.0543771 0.2467517 0.1345152 -0.1497135 0.0532594 0.1905001 0.1768071 0.9332353 1.0000000 0.9997490 0.9702766 1.0000000 -0.2033005 0.2379558 0.1382074 0.1901938 0.1957423 -0.4536453 0.4741055 -0.0924987 -0.0060165 0.6489942 0.4380296 -0.5551173 -0.3468378 -0.2771595 0.1231691 0.0350433 0.0746633 0.2708441 -0.1241421 0.0612022 -0.1852163 -0.7886182 -0.5819749 0.1396370
ksf_salinity 0.0829652 0.0671382 0.0531250 0.2429415 0.1337227 -0.1474096 0.0415236 0.1820462 0.1679188 0.9406537 0.9997490 1.0000000 0.9649314 0.9997490 -0.2126613 0.2491749 0.1494531 0.1813500 0.2092271 -0.4627142 0.4823687 -0.0848427 0.0113509 0.6601301 0.4461189 -0.5674082 -0.3385898 -0.2745012 0.1250357 0.0373635 0.0760974 0.2692969 -0.1147500 0.0573301 -0.1753525 -0.7875907 -0.5848260 0.1352252
ksf_density 0.0857606 0.0418348 0.0500105 0.2415053 0.1152359 -0.1542920 0.1538986 0.2477928 0.2394484 0.8186142 0.9702766 0.9649314 1.0000000 0.9702766 -0.0902638 0.1147994 0.0118651 0.3014574 0.0465743 -0.3605941 0.3953694 -0.1703269 -0.2018488 0.5338348 0.3585039 -0.4278833 -0.4391786 -0.3155349 0.1044908 0.0128370 0.0607018 0.2841284 -0.2162236 0.1122612 -0.2749112 -0.7951746 -0.5608398 0.2078840
ksf_total_dissolved_solids 0.0844293 0.0650358 0.0543771 0.2467517 0.1345152 -0.1497135 0.0532595 0.1905002 0.1768072 0.9332353 1.0000000 0.9997490 0.9702766 1.0000000 -0.2033005 0.2379557 0.1382074 0.1901937 0.1957423 -0.4536453 0.4741055 -0.0924987 -0.0060165 0.6489942 0.4380295 -0.5551172 -0.3468378 -0.2771594 0.1231691 0.0350433 0.0746633 0.2708441 -0.1241422 0.0612022 -0.1852164 -0.7886182 -0.5819749 0.1396370
ksf_chlorophyll_a_fluorescence 0.0457172 -0.0461447 0.0257222 -0.0206645 -0.0216596 0.0164766 0.3961686 0.3101946 0.3239955 -0.3510525 -0.2033005 -0.2126613 -0.0902638 -0.2033005 1.0000000 -0.8607477 -0.8833276 0.7955335 -0.3588821 0.2868415 -0.5286177 0.4233259 -0.4012481 -0.5750620 -0.3942648 0.6568287 -0.2354962 -0.4266384 -0.1310980 -0.1781576 -0.0763655 0.2253168 0.0115316 0.6302773 -0.4339729 0.1406013 0.0122943 0.7437201
ksf_ammonium -0.0936273 0.1048357 -0.0844702 0.0181905 0.0404987 -0.0837436 -0.6618045 -0.5775877 -0.5902213 0.3996425 0.2379558 0.2491749 0.1147994 0.2379557 -0.8607477 1.0000000 0.9890795 -0.6897750 0.4321254 -0.2318574 0.5982317 -0.4682735 0.3686412 0.7414997 0.5276712 -0.8359363 0.0737675 0.1698154 0.1514544 0.2036383 0.0848716 -0.2902736 0.0156179 -0.5918573 0.5940213 -0.1471044 0.0430297 -0.6420254
ksf_ammonium_m_v -0.0865921 0.1002260 -0.0740944 0.0096511 0.0362214 -0.0742769 -0.6358065 -0.5593437 -0.5711790 0.3148732 0.1382074 0.1494531 0.0118651 0.1382074 -0.8833276 0.9890795 1.0000000 -0.7759032 0.4203488 -0.1908605 0.5318049 -0.4795163 0.3968552 0.6496869 0.4616555 -0.7624635 0.1494658 0.2541057 0.1352355 0.1986609 0.0743319 -0.3248831 0.0163803 -0.6366673 0.5980937 -0.0521677 0.1196284 -0.7172083
ksf_barometric_pressure -0.0347621 -0.0485050 -0.0258200 0.0092874 -0.0051718 0.0028538 0.4145333 0.3745947 0.3814287 0.0031417 0.1901938 0.1813500 0.3014574 0.1901937 0.7955335 -0.6897750 -0.7759032 1.0000000 -0.2544938 0.0598565 -0.1860494 0.3963399 -0.4099253 -0.1855226 -0.1413354 0.3246883 -0.3569781 -0.4928167 -0.0487539 -0.1263615 -0.0223135 0.3215909 -0.0173451 0.6985084 -0.4024226 -0.2761582 -0.2842189 0.8685532
outdoor_temperature 0.0195322 0.2153271 -0.0463847 0.0280953 0.0293611 -0.1178618 -0.2292270 -0.1084533 -0.1232407 0.3959325 0.1957423 0.2092271 0.0465743 0.1957423 -0.3588821 0.4321254 0.4203488 -0.2544938 1.0000000 -0.3026748 0.1869662 -0.0127460 0.4011849 0.4418271 0.2967175 -0.4834497 0.1725714 0.0749674 0.0691138 0.0581744 0.0358569 -0.0169590 0.0631025 -0.1646634 0.1689941 -0.2321664 -0.1871685 -0.1782001
wind_speed_mph -0.0771027 0.0492198 -0.1224943 -0.0678494 -0.1140219 -0.0889728 0.1534301 0.0352574 0.0498780 -0.5439259 -0.4536453 -0.4627142 -0.3605941 -0.4536453 0.2868415 -0.2318574 -0.1908605 0.0598565 -0.3026748 1.0000000 -0.4765779 -0.0939130 -0.3173005 -0.4621201 -0.3231760 0.4502335 -0.0783468 -0.0949108 -0.1040043 -0.0635963 -0.0788184 -0.1791866 -0.1101333 -0.0063717 -0.0025371 0.5007997 0.5864731 -0.0484730
hourly_rain_inch_hr -0.0359133 -0.0429782 -0.0246000 0.0282027 0.0259283 -0.0063588 -0.4976613 -0.4078243 -0.4224166 0.5450024 0.4741055 0.4823687 0.3953694 0.4741055 -0.5286177 0.5982317 0.5318049 -0.1860494 0.1869662 -0.4765779 1.0000000 0.0336440 0.3148499 0.7965747 0.5770477 -0.7713297 -0.0996121 -0.0970320 0.1854863 0.1970381 0.1416682 -0.0209377 0.2724594 -0.1187575 0.4585839 -0.3462769 -0.2448090 -0.0885890
wind_direction 0.0859623 -0.1627664 0.1188072 -0.0022290 0.0135303 0.2201663 0.0825067 0.1402555 0.1326193 0.0323238 -0.0924987 -0.0848427 -0.1703269 -0.0924987 0.4233259 -0.4682735 -0.4795163 0.3963399 -0.0127460 -0.0939130 0.0336440 1.0000000 0.4198282 -0.0754514 -0.0462230 0.1874975 0.1761957 -0.1825247 -0.0255414 -0.0494484 0.0216852 0.2334988 0.5672571 0.5206991 -0.0061745 0.1905234 -0.1382811 0.5670992
water_temperature -0.0087378 -0.0283075 0.0140224 -0.0724172 -0.0428091 0.0923373 -0.3420082 -0.2087737 -0.2262222 0.2865474 -0.0060165 0.0113509 -0.2018488 -0.0060165 -0.4012481 0.3686412 0.3968552 -0.4099253 0.4011849 -0.3173005 0.3148499 0.4198282 1.0000000 0.3775866 0.4260971 -0.4284025 0.5144683 0.3012546 0.0159270 0.0515673 0.0116853 -0.0935755 0.6383843 -0.0976242 0.5202652 0.1403990 -0.0720519 -0.1344068
dissolved_oxygen -0.0339996 0.0585572 -0.0466382 0.0470053 0.0201498 -0.0458471 -0.5694751 -0.4376101 -0.4550635 0.7548221 0.6489942 0.6601301 0.5338348 0.6489942 -0.5750620 0.7414997 0.6496869 -0.1855226 0.4418271 -0.4621201 0.7965747 -0.0754514 0.3775866 1.0000000 0.7437653 -0.9526819 -0.1688712 -0.1752407 0.1647492 0.1498976 0.0990953 -0.0048452 0.2198692 -0.1866506 0.4523083 -0.5075032 -0.3713723 -0.0978948
salinity -0.0257305 -0.0370530 -0.0197123 0.0073467 -0.0037962 0.0013861 -0.4279598 -0.3404328 -0.3518176 0.5131651 0.4380296 0.4461189 0.3585039 0.4380295 -0.3942648 0.5276712 0.4616555 -0.1413354 0.2967175 -0.3231760 0.5770477 -0.0462230 0.4260971 0.7437653 1.0000000 -0.7307549 -0.0883699 -0.1280295 0.0166544 0.0186241 -0.0302281 -0.1046014 0.4256489 -0.1210594 0.5321850 -0.2846815 -0.2094789 0.0089806
conductivity 0.0735778 -0.0828898 0.0876671 -0.0112005 -0.0072471 0.0830528 0.6284400 0.5010454 0.5180174 -0.6892248 -0.5551173 -0.5674082 -0.4278833 -0.5551172 0.6568287 -0.8359363 -0.7624635 0.3246883 -0.4834497 0.4502335 -0.7713297 0.1874975 -0.4284025 -0.9526819 -0.7307549 1.0000000 0.0408472 0.0834967 -0.1604779 -0.1643408 -0.0910166 0.1071838 -0.1759728 0.3078109 -0.5285830 0.4259330 0.3052898 0.2392874
visibility -0.1033857 -0.0280149 -0.0798640 -0.1289768 -0.0710852 0.0662712 0.0619102 0.0970697 0.0914237 -0.1729555 -0.3468378 -0.3385898 -0.4391786 -0.3468378 -0.2354962 0.0737675 0.1494658 -0.3569781 0.1725714 -0.0783468 -0.0996121 0.1761957 0.5144683 -0.1688712 -0.0883699 0.0408472 1.0000000 0.6161403 -0.0294223 0.0327841 -0.0123019 -0.2149832 0.2864059 -0.0874006 0.3211975 0.3579795 0.0884107 -0.1738366
chlorophyll_a -0.1382774 -0.0349436 -0.1103464 -0.0833346 -0.0450483 0.0305550 0.1924889 0.1981719 0.1958246 -0.1916901 -0.2771595 -0.2745012 -0.3155349 -0.2771594 -0.4266384 0.1698154 0.2541057 -0.4928167 0.0749674 -0.0949108 -0.0970320 -0.1825247 0.3012546 -0.1752407 -0.1280295 0.0834967 0.6161403 1.0000000 -0.0155364 0.0420624 -0.0143158 -0.1564943 0.0267114 -0.2636625 0.1603592 0.1408106 0.0644687 -0.4485024
phosphate -0.0096799 0.0099014 -0.0114536 0.0093901 0.0060210 -0.0109520 -0.1084354 -0.0857122 -0.0890570 0.1386471 0.1231691 0.1250357 0.1044908 0.1231691 -0.1310980 0.1514544 0.1352355 -0.0487539 0.0691138 -0.1040043 0.1854863 -0.0255414 0.0159270 0.1647492 0.0166544 -0.1604779 -0.0294223 -0.0155364 1.0000000 0.9863643 0.9932947 0.5010999 -0.1729109 0.4902759 -0.0875568 -0.1457967 -0.0562004 -0.1009203
silicate -0.0343243 -0.0071649 -0.0285377 -0.0162806 -0.0120325 -0.0096234 -0.1583380 -0.1456513 -0.1484056 0.0658698 0.0350433 0.0373635 0.0128370 0.0350433 -0.1781576 0.2036383 0.1986609 -0.1263615 0.0581744 -0.0635963 0.1970381 -0.0494484 0.0515673 0.1498976 0.0186241 -0.1643408 0.0327841 0.0420624 0.9863643 1.0000000 0.9872685 0.4060123 -0.1064691 0.4489170 0.0287422 -0.0362178 0.0522981 -0.1585046
nitrate_nitrite -0.0040131 -0.0055230 -0.0030057 0.0014382 -0.0003708 0.0012419 -0.0730007 -0.0573293 -0.0598036 0.0881196 0.0746633 0.0760974 0.0607018 0.0746633 -0.0763655 0.0848716 0.0743319 -0.0223135 0.0358569 -0.0788184 0.1416682 0.0216852 0.0116853 0.0990953 -0.0302281 -0.0910166 -0.0123019 -0.0143158 0.9932947 0.9872685 1.0000000 0.4822153 -0.1449346 0.5350477 -0.1019558 -0.0939889 -0.0253212 -0.0678426
ammonia 0.1001314 -0.0004394 0.0853619 0.0720179 0.0453776 0.0443999 0.2320883 0.2659219 0.2635519 0.2197795 0.2708441 0.2692969 0.2841284 0.2708441 0.2253168 -0.2902736 -0.3248831 0.3215909 -0.0169590 -0.1791866 -0.0209377 0.2334988 -0.0935755 -0.0048452 -0.1046014 0.1071838 -0.2149832 -0.1564943 0.5010999 0.4060123 0.4822153 1.0000000 -0.1404338 0.5019528 -0.4886983 -0.3417242 -0.3362787 0.2558623
heterotrophic_bacteria -0.0134360 -0.1929484 0.0312324 -0.1159327 -0.0997131 0.1469761 -0.2382990 -0.1919719 -0.1996201 0.0290379 -0.1241421 -0.1147500 -0.2162236 -0.1241422 0.0115316 0.0156179 0.0163803 -0.0173451 0.0631025 -0.1101333 0.2724594 0.5672571 0.6383843 0.2198692 0.4256489 -0.1759728 0.2864059 0.0267114 -0.1729109 -0.1064691 -0.1449346 -0.1404338 1.0000000 0.1775969 0.6793593 0.4105066 0.1536326 0.2906262
large_phytoplankton -0.0134640 -0.1056756 -0.0053960 -0.0352733 -0.0456606 0.0412013 0.3234804 0.3103527 0.3129724 -0.0224513 0.0612022 0.0573301 0.1122612 0.0612022 0.6302773 -0.5918573 -0.6366673 0.6985084 -0.1646634 -0.0063717 -0.1187575 0.5206991 -0.0976242 -0.1866506 -0.1210594 0.3078109 -0.0874006 -0.2636625 0.4902759 0.4489170 0.5350477 0.5019528 0.1775969 1.0000000 -0.2522688 -0.0902994 -0.1071431 0.7484296
synechococcus_population_1 -0.1704429 -0.0900088 -0.1234927 -0.1443967 -0.1069427 0.0238956 -0.5881012 -0.5709042 -0.5769949 -0.0254392 -0.1852163 -0.1753525 -0.2749112 -0.1852164 -0.4339729 0.5940213 0.5980937 -0.4024226 0.1689941 -0.0025371 0.4585839 -0.0061745 0.5202652 0.4523083 0.5321850 -0.5285830 0.3211975 0.1603592 -0.0875568 0.0287422 -0.1019558 -0.4886983 0.6793593 -0.2522688 1.0000000 0.4010366 0.3332523 -0.1601991
synechococcus_population_2 0.0111838 -0.0982964 0.0507049 -0.1242146 -0.0849254 0.1100994 -0.1334547 -0.2235499 -0.2146809 -0.6926454 -0.7886182 -0.7875907 -0.7951746 -0.7886182 0.1406013 -0.1471044 -0.0521677 -0.2761582 -0.2321664 0.5007997 -0.3462769 0.1905234 0.1403990 -0.5075032 -0.2846815 0.4259330 0.3579795 0.1408106 -0.1457967 -0.0362178 -0.0939889 -0.3417242 0.4105066 -0.0902994 0.4010366 1.0000000 0.7350776 -0.1711927
prochlorococcus -0.0571083 -0.0479750 -0.0505093 -0.0604132 -0.0495029 -0.0781956 -0.1143586 -0.2058450 -0.1966661 -0.5511618 -0.5819749 -0.5848260 -0.5608398 -0.5819749 0.0122943 0.0430297 0.1196284 -0.2842189 -0.1871685 0.5864731 -0.2448090 -0.1382811 -0.0720519 -0.3713723 -0.2094789 0.3052898 0.0884107 0.0644687 -0.0562004 0.0522981 -0.0253212 -0.3362787 0.1536326 -0.1071431 0.3332523 0.7350776 1.0000000 -0.3242143
lysbeths_mystery_cells_events -0.0063553 -0.1044493 0.0083284 -0.0375336 -0.0466960 0.0764354 0.2899786 0.2723317 0.2758581 0.0235405 0.1396370 0.1352252 0.2078840 0.1396370 0.7437201 -0.6420254 -0.7172083 0.8685532 -0.1782001 -0.0484730 -0.0885890 0.5670992 -0.1344068 -0.0978948 0.0089806 0.2392874 -0.1738366 -0.4485024 -0.1009203 -0.1585046 -0.0678426 0.2558623 0.2906262 0.7484296 -0.1601991 -0.1711927 -0.3242143 1.0000000


Specific Relationship

Correlation Between Interpolated Weight and Interpolated Dissolved Oxygen
results <- corr.test(x = clams_growth_biogeochem_vars_interp$clams_count, 
                     y = clams_growth_biogeochem_vars_interp$dissolved_oxygen,
                     method = "pearson", ci = TRUE)

print(results, short=FALSE)
Call:corr.test(x = clams_growth_biogeochem_vars_interp$clams_count, 
    y = clams_growth_biogeochem_vars_interp$dissolved_oxygen, 
    method = "pearson", ci = TRUE)
Correlation matrix 
[1] -0.03
Sample Size 
[1] 290
These are the unadjusted probability values.
  The probability values  adjusted for multiple tests are in the p.adj object. 
[1] 0.56

 Confidence intervals based upon normal theory.  To get bootstrapped values, try cor.ci
      raw.lower raw.r raw.upper raw.p lower.adj upper.adj
NA-NA     -0.15 -0.03      0.08  0.56     -0.15      0.08
Adjusted P-Value
adjusted_p_values <- results$p.adj
print(adjusted_p_values)
[1] 0.5641706

All Relationships

Specific Relationship

Back to top